package mywork

import akka.actor.{Actor, ActorLogging}

/**
  * Created by shichen on 2017/8/1.
  */
object MyMaster {
  case class Ack(workId: String)
}

class MyMaster extends Actor with ActorLogging {
  import MyMaster._

  override def preStart(): Unit = {
    log.info("master singleton started")
  }

  override def receive: Receive = {
    case work: MyWork =>
      log.info("master recv work")
      sender() ! Ack(work.workId) //不写work.workId也能编译通过？
  }
}
